<%@ page language="java" pageEncoding="utf-8"
	contentType="text/html; charset=utf-8"%>
<%@ include file="../include/taglib.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>订单信息</title>
		<%@ include file="../include/jsCss.jsp"%>
		<script>
			function deleteMenu(id) {
				var dt = new Date();
				$.ajax( {
					type : "POST",
					url : "order!orderDelete.html",
					data : "orderId=" + id + "&date=" + dt,
					success : function(data) {
						if ($.trim(data) == 'success'){
							alert('删除成功');
							document.location.reload();
						}
					}
				});
			}
			
			
		</script>

	</head>

	<body>
		<form action="order!orderList.html" method="post">
			<table border="1" width="100%">
				<tr>
					<th colspan="13">
						<h2>
							订单信息
						</h2>
					</th>
				</tr>
				<tr>
					<td style="border: 0px;" colspan="2">
						联系方式：
					</td>
					<td style="border: 0px;" width="70">
						<input type="text" name="contact" />
					</td>
					<td style="border: 0px;">
						<input type="submit" value="搜索" />
					</td>
					<td colspan="10"
						style="border: 0px; text-align: right; padding-right: 20px;">
						<input type="button" value="查询当天订单" />
						<input type="button" value="查询本周订单" /> 
						<a href="order!orderAdd.html">新增订单</a> 
					</td>
				</tr>
				<tr>
					<td><input type="checkbox" onclick="checkedAll(this)"/></td>
					<td>
						编号
					</td>
					<td>
						订单编号
					</td>
					<td>
						姓名
					</td>
					<td>
						联系方式
					</td>
					<td>
						就餐时间
					</td>
					<td>
						人数
					</td>
					<td>
						包厢
					</td>
					<td>
						状态
					</td>
					<td>
						操作
					</td>
				</tr>

				<s:iterator value="orderList" status="index">
					<tr>
						<td>
							<input type="checkbox" name="userCheck"/>
						</td>
						<td>
							${index.count}
						</td>
						
						<td>
							<s:property value="orderId" />
						</td>
						<td>
							<s:property value="name" />
						</td>
						<td>
							<s:property value="contact" />
						</td>
						<td>
							<s:property value="repastDate" />
						</td>
						<td>
							<s:property value="peopleNum" />
						</td>
						<td>
							<s:property value="boxId" />
						</td>
						<td>
							<s:property value="status" />
						</td>
						<td>
							<a
								href="order!orderUpdate.html?orderId=<s:property value="orderId" />">修改
							</a> 
							|
							<a href="javascript:deleteMenu(<s:property value="orderId" />)">删除</a>
							|
							<a href="order!orderQuery.html?orderId=<s:property value="orderId" />" target="_blank">查看</a>
						</td>
					</tr>
				</s:iterator>
			</table>
			<div>
				<jsp:include page="../include/page.jsp"></jsp:include>
			</div>
		</form>
	</body>
</html>
<script type="text/javascript">
	function checkedAll(t) { 
		$("input[name='userCheck']").each(function(i,item){
			 item.checked = t.checked;
		}); 
	}
</script>